﻿using Lamex.Common;
using Lamex.Interface;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Lamex.Library
{
    public partial class frmModuleContainer : frmBaseChild
    {
        public frmModuleContainer()
        {
            InitializeComponent();
      
            string str = System.AppDomain.CurrentDomain.BaseDirectory;
            this.TextChanged += new EventHandler(frmModuleContainer_TextChanged);
            pictureEdit1.Image = Image.FromFile(str + @"image\\LamexMES_bgImage.gif");
            //pictureEdit1.Image = Image.FromFile(str + @"image\\MES_Background_Image_Blue.gif");
            //xtraTabPage1.ImageOptions.Image = Image.FromFile(str + @"image\\workspace_20190201.jpg");
            ChangeLanguage();
        }
        private void frmModuleContainer_TextChanged(object sender ,EventArgs e)
        {
            ChangeLanguage();
        }
        private void ChangeLanguage()
        {
            if (Loginer.CurrentUser.ChangeLanguage == 0)
                this.Text = "主窗体";
            else
                this.Text = "WorkSpace";
        }
        /// <summary>
        /// 显示模块主窗体容器的按钮
        /// </summary>
        public override void InitButtons()
        {
            IMdiForm mdi = (IMdiForm)this.MdiParent;
            _buttons.AddRange(mdi.MdiButtons);

            _buttons.GetButtonByName("btnClose").Enable = false;
            this.ControlBox = false;

        }
    }
}
